package com.action.commute;

import com.db.commute.CommuteDAO;

public class CworkUpdateAction {	
	private int cno;
	private CommuteDAO commDAO;
	
	public void setCommDAO(CommuteDAO commDAO) {
		this.commDAO = commDAO;
	}
	public void setCno(int cno) {
		this.cno = cno;
	}
	
	public String execute(){		
		String result = "";	
		try {
			if(commDAO.CwExist(cno) == false){		
				commDAO.UpdateCwork(cno);
			}
			result = "success";
		} catch (Exception e) {
			System.out.println("CworkUpdateAction.execute():"+e.toString());
			result = "error";
		}
		return result;
	}
}
